package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author REMY Timothée and CARTIER Arthur
 * 
 */
public class SendButtonListener implements ActionListener {

	OneDiscussionTab odt;

	/**
	 * @param odt
	 */
	public SendButtonListener(final OneDiscussionTab odt) {
		super();

		this.odt = odt;
	}

	/**
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
	 * @param e
	 */
	@Override
	public void actionPerformed(final ActionEvent e) {
		odt.getDiscussion().sendMessage(odt.getNewMessageField().getText(),
				odt.getMe());
		odt.getNewMessageField().setText("");
		odt.repaint();
	}

}
